<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>上传图片</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
<link rel="stylesheet" type="text/css" href="/style/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" />
</head>
<!-- BEGIN BODY -->
<body>
<div id="_form" style="float:left;width:100%; height:auto; background:#fff;">
  <form method="post" action="/article/upload_do" enctype="multipart/form-data" onsubmit="return ck();">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15%" height="40">图片一</td>
        <td><input type="file" name="files[]"></td>
      </tr>
      <tr>
        <td height="40">图片二</td>
        <td><input type="file" name="files[]"></td>
      </tr>
      <tr>
        <td height="40">图片三</td>
        <td><input type="file" name="files[]"></td>
      </tr>
      <tr>
        <td height="40">图片四</td>
        <td><input type="file" name="files[]"></td>
      </tr>
      <tr>
        <td height="40">图片五</td>
        <td><input type="file" name="files[]"></td>
      </tr>
      <tr>
        <td height="40">&nbsp;</td>
        <td>只支持JPG图片，每张图片大小2M以内</td>
      </tr>
      <tr>
        <td height="40">&nbsp;</td>
        <td><input type="submit" value="上传" class="btn green"></td>
      </tr>
    </table>
  </form>
</div>
<div id="_load"  style="float:left;width:100%; display:none; background:#fff; height:280px;line-height:40px;">
<img src="/style/assets/img/loading.gif">
<p>正在上传图片，不要刷新网页或执行其他操作.</p>
<p>上传完成后会自动将图片插入到详细内容中.</p>
</div>
<script type="text/javascript" src="/style/assets/plugins/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
function ck(){
	
	var _f = 0;
	$("form input").each(function(index, element) {
        
		if( $(this).attr("type")=="file"){
			
			if( $(this).prop("value")!=""){
				
				var _arr = 	$(this).prop("value").split(".");
				if(_arr[_arr.length-1].toLowerCase() =="jpg"){
					_f += 1;	
				}
				
			}
			
		}
		
    });
	
	if(_f>0){
	
		$("#_form").css("display","none");
		$("#_load").css("display","block");
		//return false;
	
	}
	else{
		alert("请选择图片文件，且必须是JPG格式");
		return false;	
	}
}
</script>
</body>
</html>